<template>
    <!-- 退费任务流转列表 -->
    <div class="fillcontain">

        <el-dialog
				width="60%"
                title="流转记录信息"
                :visible.sync="drawer"
                :before-close="handleClose">
            <div class="contain">
                <!-- 查询结果列表 -->
                <div class="table_container">
                    <el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark"
                              highlight-current-row header-cell-class-name="table-header-class"
                              style="width:100%">
                        <el-table-column property="SSERIALNO" label="序号" align='center' show-overflow-tooltip min-width="100"></el-table-column>
                        <el-table-column property="SNODEDES" label="节点名称" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                        <el-table-column property="SUSERID" label="处理人员" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                        <el-table-column property="SBEGINTIME" label="开始时间" align='center' show-overflow-tooltip min-width="160"></el-table-column>
						<el-table-column property="SENDTIME" label="结束时间" align='center' show-overflow-tooltip min-width="160"></el-table-column>
                        <el-table-column :formatter="changeDesc" label="预警超时记录" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                        <el-table-column property="SREMARK" label="备注" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                    </el-table>
                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script>
	import {mapGetters} from 'vuex'
	import {queryListByTaskNo } from "@/api/refund/RefundCommon";
	import constant from '@/utils/constant';
    export default {
		name:"refund-his",
        data() {
            return {
                tableData: [],
                loading: false,

                showAdd: false,
            }
        },
		props: {
			drawer: {
				type: Boolean,
				default: false
			},
			taskNo: {
				type: String
			},
		},
        methods: {
            handleClose() {
                this.$emit('close', this.drawer);
            },
			getList(taskNo){
				this.$store.dispatch('loading/CHANGE_LOADING', true);
				let that = this;
				queryListByTaskNo(taskNo).then(function(result){
					if (result.resultCode == constant.SUCCESS && result.data ) {
						that.tableData = result.data;
					} 
					that.$store.dispatch('loading/CHANGE_LOADING', false);
				}).catch(function(){
					that.$message({
						message: "查询失败，请稍后重试",
						type: 'error'
					});
					that.$store.dispatch('loading/CHANGE_LOADING', false);
				})
			},
			/* 预警超时记录转换 */
			changeDesc:function(row){
				if (row.SSUBTASKNO =="O") {
					return "超时";
				}
				if(row.SSUBTASKNO=="A") {
					return "预警";
				}
				return "";
			}
        },
		watch: {
            taskNo: function (newValue) {
                if (newValue != undefined && newValue != '') {
					this.tableData=[];
					this.getList(newValue);
				}
            },
        },
        computed: {
            ...mapGetters(['tags']),
        },
        activated() {
            if (this.reload) {
                this.$store.dispatch('loading/CHNAGE_RELOAD', false)
                Object.assign(this.$data, this.$options.data());
            }
        }
    }
</script>

<style lang="less" scoped>
	.dialog{
		width: 80%;
	}
    .fillcontain {
        padding-bottom: 0;
    }

    .contain {
        background: #fff;
        padding: 10px;
        margin-bottom: 20px;
    }
	
</style>



